//var baseUrl = "http://i1l5986219.51mypc.cn:27485";
//var webSocketUrl = "ws://i1l5986219.51mypc.cn:27485/websocket";
//var currShangZhuangUrl = baseUrl + "/pod/zhuangjia.do";
var baseUrl = "http://localhost:8080";
var webSocketUrl = "ws://localhost:8080/websocket";
var currShangZhuangUrl = baseUrl + "/pod/zhuangjia.do";
var actionUrl = baseUrl + "/action/";

function money_Formatter(value, rowData, rowIndex){
    if(value){
        return value.toFixed(0);
    }else{
        return null;
    }
}

function money_Formatter2(value, rowData, rowIndex){
    if(value){
        return value.toFixed(2);
    }else{
        return null;
    }
}

function date_Formatter(value, rowData, rowIndex){
    return date2String(value);
}

function datetime_Formatter(value, rowData, rowIndex){
    return timeStamp2String(value);
}

function timeStamp2String(time){
    if(time && time != ''){
        var datetime = new Date();
        datetime.setTime(time);
        var year = datetime.getFullYear();
        var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
        var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
        var hour = datetime.getHours()< 10 ? "0" + datetime.getHours() : datetime.getHours();
        var minute = datetime.getMinutes()< 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
        var second = datetime.getSeconds()< 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
        return year + "-" + month + "-" + date+" "+hour+":"+minute+":"+second;
    }
}

function date2String(time){
    if(time && time != ''){
        var datetime = new Date();
        datetime.setTime(time);
        var year = datetime.getFullYear();
        var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
        var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
        return year + "-" + month + "-" + date;
    }
}
